// import xlsx from 'node-xlsx';
const XLSX = require('xlsx');

module.exports = function generateXlsxFn () {
  const data = [
    [1, 2, 3],
    [true, false, null, 'sheetjs'],
    ['foo', 'bar', new Date('2014-02-19T14:30Z'), '0.3'],
    ['baz', null, 'qux'],
  ];
  const range = { s: { c: 0, r: 0 }, e: { c: 0, r: 3 } }; // A1:A4
  const sheetOptions = { '!merges': [range] };

  var buffer = XLSX.build([{ name: 'mySheetName', data: data }], { sheetOptions }); // Returns a buffer
}